package com.jy.datapipeline.importserver.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.SneakyThrows;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class ImportRule implements BasicEntity {

    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    private String ruleId;

    private String dataSourceId;

    private String sqlldrInfoId;

    private String ruleName;

    private String seperator;

    private String targetDatabase;

    private String sourceDatabase;

    private String loadType;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    private String ruleTableId;

    private String importMode;

    private String sqlldrParams;

    private String sid;

    @SneakyThrows
    @Override
    public BasicEntity createClone() {
        return (BasicEntity) clone();
    }
}